let _baseURL = 'https://www.xpssp.cn';
// let _baseURL = 'http://api.xpssp.cn';
switch (uni.getSystemInfoSync().platform) {
	case 'devtools':
		_baseURL = 'http://api.xpssp.cn';
		console.log('运行在开发者工具上', _baseURL);
		break;
	default:
		break;
}

export const baseURL = _baseURL;

export const payType = {
	beanPay: 0,
	wxpay: 1,
	alipay: 2,
	toutiao: 3,
	kuaishoupay: 6,
};
// 直接支付的平台（不需要自己写样式的，直接调对应平台的收银台）
export const directPayPlatforms = [
	'toutiao',
	'kuaishou',
];

export const loginFrom = {
	weixin: 1,
	alipay: 2,
	toutiao: 3,
	kuaishou: 6,
};
export const applyId = {
	alipay: 7,
}
export const birthTimeList = [
  '00:00-00:59',
  '01:00-02:59',
  '03:00-04:59',
  '05:00-06:59',
  '07:00-08:59',
  '09:00-10:59',
  '11:00-12:59',
  '13:00-14:59',
  '15:00-16:59',
  '17:00-18:59',
  '19:00-20:59',
  '21:00-22:59',
  '22:00-23:59',
];
export const backColorList = [{
	id: '1',
	background: "#FFFFFF",
	text: '白色背景',
}, {
	id: '2',
	background: "#438EDB",
	text: '标准蓝背景',
}, {
	id: '3',
	background: "#FF0000",
	text: '标准红背景',
}, {
	id: '4',
	background: "#D9D9D9",
	text: '海军蓝背景',
}, {
	id: '5',
	background: "#A6A6A6",
	text: '科技灰背景',
}, {
	id: '6',
	background: "#2E6599",
	text: '企业灰背景',
}, {
	id: '7',
	background: "#992626",
	text: '玫瑰红背景',
}];
export const getBackGroundText = (background) => {
	const a = backColorList.find(item => item.background === background);
	return a ? a.text : '--';
}
export const sizeList = [{
	id: 1,
	specId: 1,
	minSize: 100,
	maxSize: 200,
	dpi: 300,
	printNum: 9,
	name: "一寸",
	value: '25x35',
	px: '295x413',
	unit: 'px',
}, {
	id: 4,
	specId: 4,
	minSize: 100,
	maxSize: 200,
	dpi: 300,
	printNum: 4,
	name: "二寸",
	value: '35x49',
	px: '413x579',
	unit: 'px',
}, {
	id: 3,
	specId: 3,
	minSize: 50,
	maxSize: 200,
	dpi: 300,
	printNum: 4,
	name: "大一寸",
	value: '33x48',
	px: '390x567',
	unit: 'px',
}, {
	id: 2,
	specId: 2,
	minSize: 50,
	maxSize: 200,
	dpi: 300,
	printNum: 8,
	name: "小一寸",
	value: '22x32',
	px: '260x378',
	unit: 'px',
}, {
	id: 6,
	specId: 6,
	minSize: 100,
	maxSize: 200,
	dpi: 300,
	printNum: 4,
	name: "大二寸",
	value: '35x53',
	px: '413x626',
	unit: 'px',
}, {
	id: 5,
	specId: 5,
	minSize: 100,
	maxSize: 200,
	dpi: 300,
	printNum: 6,
	name: "小二寸",
	value: '35x45',
	px: '413x531',
	unit: 'px',
}, {
	id: 19,
	specId: 19,
	minSize: 100,
	maxSize: 200,
	dpi: 300,
	printNum: 2,
	name: "三寸",
	value: '55x84',
	px: '650x992',
	unit: 'px',
}, {
	id: 20,
	specId: 20,
	minSize: 100,
	maxSize: 200,
	dpi: 300,
	printNum: 1,
	name: "四寸",
	value: '76x102',
	px: '898x1181',
	unit: 'px',
}, ]

export const lifeSizeList = [{
	id: 21,
	specId: 21,
	value: '1050x1500',
	text: '5寸',
}, {
	id: 230,
	specId: 230,
	value: '1200x1800',
	text: '6寸',
}, ];

export const imagePrefix = 'https://sspzjz.oss-cn-shanghai.aliyuncs.com';
const sketchTypes = [{
	value: 'head',
	text: '大头照',
}, {
	value: 'full',
	text: '全身照',
}, ];
const algoTypes = [{
	value: 'anime',
	text: '日漫风',
}, {
	value: '3d',
	text: '3D特效',
}, {
	value: 'handdrawn',
	text: '手绘风',
}, {
	value: 'sketch',
	text: '铅笔画',
}, {
	value: 'artstyle',
	text: '艺术特效',
}, {
	value: 'claborate',
	text: '国画工笔画',
}, {
	value: 'hongkong',
	text: '港漫风',
}, {
	value: 'comic',
	text: '漫画风格',
}, {
	value: 'animation3d',
	text: '动画3D',
}, ]

export const versatileShowMap = {
	'black-white-coloring': {
		swipers: [{
			id: 1,
			src: '/swiper/heibai1.png',
		}, {
			id: 2,
			src: '/swiper/heibai2.png'
		}, {
			id: 3,
			src: '/swiper/heibai3.png'
		}, ],
		name: '黑白上色',
		packType: 7, //套餐类型（用于查询套餐）
		recordType: 7, //订单类型，用于保存提交接口上送
		getFieldList({
			width,
			height,
			fileSize,
			imgType
		}) {
			return [{
				title: '图片尺寸',
				desc: `${width}*${height}px`,
			}, {
				title: '图片大小',
				desc: `${fileSize}KB`,
			}, {
				title: '分辨率',
				desc: `300DPI`,
			}, ]
		},
		async api({
			payAmount,
			imageUrl
		}) {
			const payload = {
				payAmount,
				imageUrl,
			};
			const res = await uni.$request('/api/busi/photo/colorizeImage', payload);
			return {
				shuiyinUrl: res.data.shuiyinUrl,
				imageUrl: res.data.imageUrl,
			}
		},
	},
	'old-photo-restoration': {
		swipers: [{
			id: 1,
			src: '/swiper/laozhangpian1.png'
		}, {
			id: 2,
			src: '/swiper/laozhangpian2.png'
		}, {
			id: 3,
			src: '/swiper/laozhangpian3.png'
		}, ],
		name: '老照片修复',
		packType: 10,
		recordType: 8,
		getFieldList({
			width,
			height,
			fileSize,
			imgType
		}) {
			return [{
				title: '图片尺寸',
				desc: `${width}*${height}px`,
			}, {
				title: '图片大小',
				desc: `${fileSize}KB`,
			}, {
				title: '分辨率',
				desc: `300DPI`,
			}, ]
		},
		async api({
			payAmount,
			imageUrl
		}) {
			const payload = {
				payAmount,
				imageUrl,
			};
			const res = await uni.$request('/api/busi/photo/enhanceFace', payload);
			return {
				shuiyinUrl: res.data.shuiyinUrl,
				imageUrl: res.data.imageUrl,
			}
		}
	},
	'sketch-portrait': {
		swipers: [{
			id: 1,
			src: '/swiper/sumiao1.png'
		}, {
			id: 2,
			src: '/swiper/sumiao2.png'
		}, {
			id: 3,
			src: '/swiper/sumiao3.png'
		}, ],
		name: '人物素描化',
		packType: 9,
		recordType: 5,
		defaultValue: sketchTypes[0].value,
		switchList: sketchTypes,
		getFieldList({
			photoStyle,
			fileSize,
			imgType,
		}) {
			const photoStyleText = sketchTypes.find(item => item.value === photoStyle);
			return [{
				title: '风格类型',
				desc: photoStyleText.text,
			}, {
				title: '图片大小',
				desc: `${fileSize}KB`,
			}, {
				title: '图片格式',
				desc: imgType,
			}, ]
		},
		async api({
			payAmount,
			imageUrl,
			currentValue,
		}) {
			const payload = {
				payAmount,
				imageUrl,
				returnType: currentValue,
			};
			const res = await uni.$request('/api/busi/photo/generateHumanSketchStyle', payload);
			return {
				shuiyinUrl: res.data.shuiyinUrl,
				imageUrl: res.data.imageUrl,
			}
		},
	},
	'manga-photos': {
		swipers: [{
			id: 1,
			src: '/swiper/dongman1.png'
		}, {
			id: 2,
			src: '/swiper/dongman2.png'
		}, {
			id: 3,
			src: '/swiper/dongman3.png'
		}, ],
		name: '人物动漫化',
		packType: 8,
		recordType: 6,
		defaultValue: algoTypes[0].value,
		switchList: algoTypes,
		getFieldList({
			photoStyle,
			fileSize,
			imgType,
		}) {
			const photoStyleText = algoTypes.find(item => item.value === photoStyle);
			return [{
				title: '风格类型',
				desc: photoStyleText.text,
			}, {
				title: '图片大小',
				desc: `${fileSize}KB`,
			}, {
				title: '图片格式',
				desc: imgType,
			}, ]
		},
		async api({
			payAmount,
			imageUrl,
			currentValue,
		}) {
			const payload = {
				payAmount,
				imageUrl,
				algoType: currentValue,
			};
			const res = await uni.$request('/api/busi/photo/generateHumanAnimeStyle', payload);
			return {
				shuiyinUrl: res.data.shuiyinUrl,
				imageUrl: res.data.imageUrl,
			}
		},
	},
}